//
//  TTHttpManager.m
//  ExhibitionHall
//
//  Created by 王洋 on 2019/6/3.
//  Copyright © 2019 王洋. All rights reserved.
//

#import "TTHttpManager.h"

@implementation TTHttpManager

//标准get请求
+(void)getRequestWithUrl:(NSString *)url TimeOut:(NSInteger)timeOut GetData:(NSDictionary *)getData FinishBlock:(finishBlock)finishBlock FailedBlock:(failedBlock)failedBlock{
    
    TTHttpRequest *request=[[TTHttpRequest alloc]init];
    request.url=url;
    request.timeOut=timeOut;
    request.getData=getData;
    request.finishBlock=finishBlock;
    request.failedBlock=failedBlock;
    
    if (![Utilities getProxyStatus]) {
        [request getStart];
    } else {
        return;
    }
}

//标准post请求
+(void)postRequestWithUrl:(NSString *)url TimeOut:(NSInteger)timeOut PostData:(NSDictionary *)postData FinishBlock:(finishBlock)finishBlock FailedBlock:(failedBlock)failedBlock{
    
    TTHttpRequest *request=[[TTHttpRequest alloc]init];
    request.url=url;
    request.timeOut=timeOut;
    request.postData=postData;
    request.finishBlock=finishBlock;
    request.failedBlock=failedBlock;

    if (![Utilities getProxyStatus]) {
        [request postStart];
    } else {
        return;
    }
}

//发送图片post
//+(void)postImgMsgWithUrl:(NSString *)url postDict:(NSDictionary *)postDict TimeOut:(NSInteger)timeOut imageData:(NSDictionary *)imageDict FinishBlock:(finishBlock)finishBlock FailedBlock:(failedBlock)failedBlock{
//    
//    TTHttpRequest *request=[[TTHttpRequest alloc]init];
//    request.url=url;
//    request.postData = postDict;
//    request.timeOut=timeOut;
//    request.imageDict=imageDict;
//    request.finishBlock=finishBlock;
//    request.failedBlock=failedBlock;
//    [request postImgMsg];
//}

@end
